﻿<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true"
    CodeFile="TypeMilkList.aspx.cs" Inherits="Admin_TypeMilkList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="titlePlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="menuPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="contentPlaceHolder" runat="Server">
    <div class="divcontent">
        <div class="search">
            <div class="cont">
                <div class="title" style="border-bottom: 1px solid #fff;">
                    <strong>Tìm Kiếm </strong>
                </div>
                <div class="box_content">
                    <ul>
                        <li>
                            <div style="width: 780px; height: 35px;">
                                <div class="divfirst" style="width: 35px;">
                                    Title :</div>
                                <div class="divlast" style="width: 200px;">
                                    <asp:TextBox ID="txtNameSearch" CssClass="textfield" runat="server" Width="190"></asp:TextBox></div>
                                <div style="width: 200px; margin-top: -5px; float: left;" class="divfirst">
                                    <asp:Button CssClass="bbutton" ID="btnSearch" OnClick="btnSearch_OnClick" runat="server"
                                        TabIndex="1" Text="Tìm Kiếm" ValidationGroup="b" />
                                    &nbsp;&nbsp;
                                    <asp:Button CssClass="bbutton" ID="btnSearchAll" OnClick="btnSearchAll_OnClick" runat="server"
                                        TabIndex="2" Text="Hiện Tất Cả" ValidationGroup="b"></asp:Button>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="display">
            <div class="control">
                <ul>
                    <li><span style="color: Red;">
                        <asp:Literal ID="lb_error" runat="server"></asp:Literal></span> </li>
                    <li>
                        <img alt="" src="<%=ResolveUrl("~/images/ar1.gif") %>" /><asp:LinkButton ID="lbtDelete"
                            OnClick="lbtDelete_Onclick" runat="server" OnClientClick="return confirmdelete();"
                            ValidationGroup="1">Xóa dòng đã chọn</asp:LinkButton></li></ul>
            </div>
            <div class="view">
                <table cellpadding="3" cellspacing="1" class="tblist" width="100%">
                    <asp:Repeater runat="server" ID="rptList" OnItemDataBound="rptList_OnItemDataBound"
                        OnItemCommand="rptList_OnItemCommand">
                        <HeaderTemplate>
                            <tr style="font-weight: bold;">
                                <td align="center" class="head">
                                    <span>No </span>
                                </td>
                                <td align="center" class="head">
                                    <asp:LinkButton ID="lbtTitle" runat="server" CommandArgument="ASC" CommandName="sortTitle"
                                        ValidationGroup="0">Title</asp:LinkButton>
                                </td>
                                <td align="center" class="head">
                                    <asp:LinkButton ID="lbtMark" runat="server" CommandArgument="ASC" CommandName="sortMark"
                                        ValidationGroup="0">Ưu tiên</asp:LinkButton>
                                </td>
                                <td align="center" class="head">
                                    <asp:LinkButton ID="lbtDescription" runat="server" CommandArgument="ASC" CommandName="Description"
                                        ValidationGroup="0">Description</asp:LinkButton>
                                    <%--                                    <asp:Label ID="Label1" runat="server" Text="Label">Description</asp:Label>
--%>
                                </td>
                                <td align="center" width="50" id="tdDelete" runat="server" class="head">
                                    <input id="checkall" onclick='CheckAll(this);' type="checkbox" name="checkall"></td>
                            </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td align="center">
                                    <asp:Literal ID="ltrNo" runat="server"></asp:Literal><asp:HiddenField ID="hidID"
                                        runat="server" />
                                </td>
                                <td>
                                    <asp:TextBox CssClass="textfield" runat="server" Width="190" ID="txtTitle" ForeColor="#444"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox CssClass="textfield" runat="server" Width="190" ID="txtMark" ForeColor="#444"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox CssClass="textfield" runat="server" Width="275" ID="txtDescription"
                                        ForeColor="#444"></asp:TextBox>
                                </td>
                                <td style="text-align: center">
                                    <input runat="server" onclick="select_change(this.form)" id="chkDelete" type="checkbox"
                                        value='<%# DataBinder.Eval(Container.DataItem, "MilkId") %>' name="delete" />
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <tr>
                        <td class="head">
                        </td>
                        <td>
                            <asp:TextBox CssClass="textfield" runat="server" Width="190" ID="txtTitle1" BackColor="White"
                                ForeColor="Black"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox CssClass="textfield" runat="server" Width="190" ID="txtMark1" BackColor="White"
                                ForeColor="Black" ValidationGroup="a"></asp:TextBox>
                            <asp:RequiredFieldValidator runat="server" ID="NReq" ControlToValidate="txtMark1"
                                Display="None" ErrorMessage="<b>Order</b><br />Không thể rỗng."></asp:RequiredFieldValidator>
                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="NReqE" TargetControlID="NReq"
                                HighlightCssClass="validatorCalloutHighlight" />
                            <asp:RegularExpressionValidator Display="None" ID="Cell" runat="server" ControlToValidate="txtMark1"
                                ValidationExpression="^[0-9,.,#]+$" ErrorMessage="<b>Mark</b><br />Chỉ là số."></asp:RegularExpressionValidator>
                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender8"
                                TargetControlID="Cell" HighlightCssClass="validatorCalloutHighlight" />
                        </td>
                        <td>
                            <asp:TextBox CssClass="textfield" runat="server" Width="275" ID="txtDescription1"
                                BackColor="White" ForeColor="Black"></asp:TextBox>
                        </td>
                        <td class="head">
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="padding-top: 12px;" align="center">
            <PagerV2:PagerV2_8 ID="hyperlinkPager" runat="server" CompactModePageCount="5" GenerateFirstLastSection="true"
                OnCommand="pager_Command" GeneratePagerInfoSection="false" GenerateSmartShortCuts="false"
                GenerateHiddenHyperlinks="false" NormalModePageCount="5" />
        </div>
        <div>
            <asp:Button CssClass="bbutton" runat="server" ID="btnSave" Text="Save" OnClick="btnSave_OnClick" />
        </div>
    </div>
    <br />
    <br />

    <script type="text/javascript">
    function confirmdelete()
    {
        return confirm("Bạn chắc chắn muốn xóa dòng này không?");
    }
    
    </script>

    <script type="text/javascript" language="javascript">
     function CheckAll(obj)
    {
        // find any item not check
        
        var countUncheck = 0;
        var checkAll = true;
        var checkList = document.getElementsByTagName("input");
            
        if(!obj.checked)
            checkAll = false;
        for(var i = 0 ; i < checkList.length ; i++)
        { 
        if(checkList[i].type == 'checkbox' && checkList[i].id.indexOf("chkDelete") >= 0 )
        {
        checkList[i].checked = checkAll;
        }
        } 
    }
   
    </script>

</asp:Content>
